package com.univrz.flexmachine.scmxml
{
	

	import com.univrz.flexmachine.core.ActivableNode;
	import com.univrz.flexmachine.core.Node;
	import com.univrz.flexmachine.scmxml.i.IState;
	import com.univrz.flexmachine.scmxml.i.IStateChild;
	import com.univrz.flexmachine.scmxml.i.IStateNode;



	
/**
 *  
 * 
 *  @eventType com.univrz.flexmachine.events.StateMachineEvent.ENTER
 */
[Event(name="enter", type="com.univrz.flexmachine.events.StateMachineEvent")]		


/**
 *  
 * 
 *  @eventType com.univrz.flexmachine.events.StateMachineEvent.EXIT
 */
[Event(name="exit", type="com.univrz.flexmachine.events.StateMachineEvent")]		



/**
 *  
 * 
 *  @eventType com.univrz.flexmachine.events.StateMachineEvent.DONE
 */
[Event(name="done", type="com.univrz.flexmachine.events.StateMachineEvent")]		



	
	
	/**
	 * 
	 * 
	 * @author aldo.bucchi@gmail.com
	 * 
	 */
	public class State extends ActivableNode implements IState
	{
		
		
		/**
		 * 
		 * 
		 * 
		 */		
		[Bindable]
		public var initial:IStateNode;
		
		
		[ArrayElementType("com.univrz.flexmachine.scmxml.i.IStateChild")]
		override public function set children( v:Array ):void
		{
			super.children = v;
		}
		override public function get children( ):Array
		{
			return super.children;
		}	
		
		
		
		private var _isComplete:Boolean;
		[Bindable("isCompleteChanged")]
		public function get isComplete( ):Boolean
		{
			return _isComplete;
		}		
		
		
		
		
		
		
		
		
		public function get isAtomic( ):Boolean
		{
		
			for each ( var node:Node in children )
			{
			
			}		
		
			return false; // ????????
		}
		
		
		
		
		
		

		
		
			
		
		
	}
	
}